BIN := builder

CXXFLAGS += -Wall -g -O0 -fdiagnostics-color=auto -std=c++11

CPP_FILES += $(wildcard *.cpp)
H_FILES += $(wildcard *.h)

INC +=
LIBS +=

BIN_PATH = ./
OBJ_DIR = ./

OBJS := $(patsubst %.cpp, $(OBJ_DIR)%.o, $(CPP_FILES))

TARGET := $(BIN_PATH)$(BIN)

.PHONY: $(TARGET) clean

$(TARGET): $(OBJS) $(H_FILES)
	@echo link... $(TARGET)
	$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(INC) $(LIBS)

$(OBJ_DIR)%.o:%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $< $(INC)

clean:
	rm -f $(TARGET) $(OBJS)
	
